import { _decorator, Component, Node, Prefab } from 'cc';
import { DiceController } from './DiceController';
const { ccclass, property } = _decorator;

@ccclass('ThrowDiceController')
export class ThrowDiceController extends Component {
    @property({ type: DiceController })
    public dice01: DiceController | null = null;

    @property({ type: DiceController })
    public dice02: DiceController | null = null;

    @property({ type: DiceController })
    public dice03: DiceController | null = null;

    @property({ type: DiceController })
    public dice04: DiceController | null = null;

    @property({ type: DiceController })
    public dice05: DiceController | null = null;

    private dices: Array<DiceController> = new Array();

    start() {
        this.dices = new Array();
        this.dices.push(this.dice01)
        this.dices.push(this.dice02)
        this.dices.push(this.dice03)
        this.dices.push(this.dice04)
        this.dices.push(this.dice05)
    }

    update(deltaTime: number) {

    }

    throwDice() {
        this.dice01.throwDice()
        this.dice02.throwDice()
        this.dice03.throwDice()
        this.dice04.throwDice()
        this.dice05.throwDice()
    }

    public getDices(): Array<DiceController> {
        return this.dices;
    }
}


